Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(proxy): protect the program when querySelectorAll throws an excep… #547

Conversation

chenweifang4
Copy link
Contributor

  • 提交符合commit规范
  • npm run test通过
详细描述

wujie 对子应用中的 getElementsByTagName, getElementsByClassName, getElementsByName 进行了拦截,并在某些条件下采用了 querySelectorAll 进行替代,根据 MDN 上的描述,如果传递给 querySelectorAll 是一个非法的字符,那么 querySelectorAll 就会抛出异常阻止程序的执行

这里需要对程序的运行做一层保护,应对外部传递给 querySelectorAll 的非法参数的情况。

举个场景,比如在使用 YouTube Player 的时候,会出现 yt:player 的情况

demo

这个时候如果不对 querySelectorAll 的执行过程进行保护,那么就会影响外部程序的执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants